﻿using CSRedis;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Microsoft.Extensions.DependencyInjection
{
    public static class RedisClientExtensions
    {


        public static IServiceCollection AddRedisClientExtensions(this IServiceCollection services, IConfiguration configuration)
        {
            // 注册 CSRedis 服务 简单 方便 //可以直接在program.cs中注入
            services.AddSingleton<CSRedisClient>(provider =>
            {
                return new CSRedisClient(configuration["Redis"]);
            });


            return services;

        }
    }
}
